package com.yuyue.springFramework.note08.entity;

/**
 * 简单类
 */
public class Human {
    //无参构造
    public Human(){}
    //一个参数的构造。
    //使用自定义注解指定构造器，用在阶段7：实例化例子中。
    @MyAutowried
    public Human(String name){
        this.name = name;
    }
    //两个参数的构造
    public Human(String name, int age){
        this.name = name;
        this.age = age;
    }

    private String name;
    private int age;

    //set、get、tostring方法
    @Override
    public String toString() {
        return "Human{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
